data_orig           = readtable('Regulatory_costs.xlsx'); 


FID = fopen('D:\Dropbox\Regulation Cost\Watch what they do not what they say\FinalTables_firstdraft\summary_survey.tex','w');
fprintf(FID, '\\begin{centering}\\begin{tabular*}{\\linewidth}{@{\\extracolsep{\\fill}}llll@{}}\\toprule \n');
fprintf(FID, 'Source &Sample & Estimate & Date   \\\\ \\midrule \n');
for i=1:9
fprintf(FID, data_orig.Source{i});
fprintf(FID, '&');
fprintf(FID, data_orig.Details{i});
fprintf(FID, '&');
fprintf(FID, data_orig.Estimate{i});
fprintf(FID, '&');
fprintf(FID, data_orig.Date{i});
fprintf(FID, '\\\\  \n');

end
% fprintf(FID, '$A$ &%5.3f & Productivity \\\\  \n',dt_reg.pro);
fprintf(FID, '\\bottomrule \\end{tabular*} \\par\\end{centering}\n');
fclose(FID); % close tex file





FID = fopen('D:\Dropbox\Regulation Cost\Watch what they do not what they say\FinalTables_firstdraft\summary_survey_online_appendix.tex','w');
fprintf(FID, '\\begin{centering}\\begin{tabular*}{\\linewidth}{@{\\extracolsep{\\fill}}lllll@{}}\\toprule \n');
fprintf(FID, 'Source &Link   \\\\ \\midrule \n');
for i=1:9
fprintf(FID, data_orig.Source{i});
fprintf(FID, '&');
% fprintf(FID, data_orig.Details{i});
% fprintf(FID, '&');
% fprintf(FID, data_orig.Estimate{i});
% fprintf(FID, '&');
% fprintf(FID, data_orig.Date{i});
% fprintf(FID, '&');
%fprintf(FID, data_orig.MainAssumption{i});
%fprintf(FID, '&');
fprintf(FID, data_orig.Link{i});
fprintf(FID, '\\\\  \n');
end
% fprintf(FID, '$A$ &%5.3f & Productivity \\\\  \n',dt_reg.pro);
fprintf(FID, '\\bottomrule \\end{tabular*} \\par\\end{centering}\n');
fclose(FID); % close tex file






FID = fopen('D:\Dropbox\Regulation Cost\Watch what they do not what they say\FinalTables_firstdraft\summary_survey_slides.tex','w');
fprintf(FID, '\\begin{centering}\\begin{tabular*}{\\linewidth}{@{\\extracolsep{\\fill}}lll@{}}\\toprule \n');
fprintf(FID, 'Source &Sample & Estimate   \\\\ \\midrule \n');
for i=1:9
fprintf(FID, data_orig.Source{i});
fprintf(FID, '&');
fprintf(FID, data_orig.Details{i});
fprintf(FID, '&');
fprintf(FID, data_orig.Estimate{i});
fprintf(FID, '\\\\  \n');

end
% fprintf(FID, '$A$ &%5.3f & Productivity \\\\  \n',dt_reg.pro);
fprintf(FID, '\\bottomrule \\end{tabular*} \\par\\end{centering}\n');
fclose(FID); % close tex file
